package days8;

public class Demo5 {
    static {
        System.out.println("Demo5类开始初始化步骤了!");
    }

    static Cat5 cat5 = new Cat5();
    Dog5 dog5 = new Dog5();

    public Demo5() {
        System.out.println("Demo5 constructor");
    }

    public static void main(String[] args) {
        System.out.println("hello world!");
        Demo5 d = new Demo5();
    }
}

class Cat5 {
    static {
        System.out.println("Cat5类开始初始化步骤了!");
    }

    static Dog5 dog5 = new Dog5();

    public Cat5() {
        System.out.println("Cat5  constructor");
    }
}

class Dog5 {
    static {
        System.out.println("Dog5类开始初始化步骤了!");
    }

    static Demo5 demo = new Demo5();

    public Dog5() {
        System.out.println("Dog5  constructor");
    }
}